//
//  MyStoreParsedResult.m
//  MyBarcodeStore
//
//  Created by mac on 2010/7/26.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "MyStoreParsedResult.h"


@implementation MyStoreParsedResult

@synthesize sourceString;
@synthesize name;
@synthesize price;
@synthesize origin;

+ (NSString *)typeName {
	return nil;
}

- initWithSrcString:(NSString *)srcString {
	if ((self = [super init]) != nil) {
		self.sourceString = srcString;
		const char *cstring = [srcString UTF8String];
		name = [[NSString alloc] initWithBytes:cstring length:20 encoding:NSUTF8StringEncoding];
		price = [[NSNumber numberWithUnsignedInt:*(unsigned int *)(cstring + 20)] retain];
		origin = [[NSString alloc] initWithBytes:cstring + 24 length:20 encoding:NSUTF8StringEncoding];
	}
	
	return self;
}

- (void)dealloc {
	[sourceString release];
	[name release];
	[price release];
	[origin release];
	[super dealloc];
}

@end
